<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>活动报名信息</title>
    <#include "../../common/link.ftl">
    <script>
        $(function () {
            // 查看失败理由
            $(".reasonBtn").click(function () {
                //数据复原
                $("#editForm textarea").val('');
                $("#editForm").clearForm(true);

                var json = $(this).data('json');
                if(json){
                    $("textarea[name='reason']").val(json);
                }
                $("#inputSynModal").modal('show');
            })
        })
    </script>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../../common/navbarMember.ftl">
    <!--菜单回显-->
    <#assign currentMenu="activityRecordMember"/>
    <#include "../../common/menuMember.ftl">
    <div class="content-wrapper">
        <section class="content-header">
            <h1>报名记录列表</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/activityRecord/member/list.do" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字：</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}" placeholder="请输入活动标题/活动地点">
                        </div>
                        &nbsp;
                        <div class="form-group">
                            <label for="applyStatus"> 状态：</label>
                            <select class="form-control" id="applyStatus" name="applyStatus">
                                <option value="-1">全部</option>
                                <option value="0">报名中</option>
                                <option value="1">报名成功</option>
                                <option value="1">报名失败</option>
                            </select>
                            <script>
                                $("#applyStatus").val(${qo.applyStatus!});
                            </script>
                        </div>
                        <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> 查询</button>
                        </a>
                    </form>
                </div>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>活动标题</th>
                        <th>地点</th>
                        <th>报名人数</th>
                        <th>报名时间</th>
                        <th>活动开始时间</th>
                        <th>活动结束时间</th>
                        <th>活动总时长</th>
                        <th>状态</th>
                        <th>报名失败原因</th>
                    </tr>
                    </thead>
                    <#list page.list as activityRecord>
                        <tr>
                            <td>${activityRecord_index+1}</td>
                            <td>
                                <a class="btn titleBtn" href="/activity/member/detail.do?id=${activityRecord.activityId!}">
                                    ${activityRecord.activityName!}
                                </a>
                            </td>
                            <td>${(activityRecord.site)!}</td>
                            <td>${(activityRecord.nowperson)!}</td>
                            <td>${(activityRecord.createTime?string('yyyy-MM-dd HH:mm:ss'))!}</td>
                            <td>${(activityRecord.startTime?string('yyyy-MM-dd HH:mm:ss'))!}</td>
                            <td>${(activityRecord.endTime?string('yyyy-MM-dd HH:mm:ss'))!}</td>
                            <td>${(activityRecord.allTime)!}</td>
                            <td>
                                 <#if activityRecord.status == 0 >
                                     报名中
                                 <#elseif activityRecord.status == 1>
                                    报名成功
                                 <#elseif activityRecord.status == 2>
                                    报名失败
                                 </#if >
                            </td>
                            <td>
                                <#if activityRecord.status == 2>
                                    <a class="btn reasonBtn" href="JavaScript:;" data-json="${activityRecord.reason}">失败理由
                                    </a>
                                </#if>
                            </td>
                        </tr>
                    </#list>
                </table>
                <!--分页-->
                <#include "../../common/page.ftl">
            </div>
        </section>
    </div>
    <#include "../../common/footer.ftl">
</div>

<div class="modal fade" id="inputSynModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalSynLabel">失败理由</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="" method="post" id="editForm">
                    <div class="form-group">
                        <div class="col-sm-12">
                            <textarea rows="10" style="min-width: 100%" name="reason"></textarea>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

</body>
</html>
